By misiu9 on
Id like to add my own menu of few links to the page. It is gonna be hardcoded into the page.tp.php file
Id like class ACTIVE to work like on any other dynamic drupal menu.
Is there a way of getting class="active" from the script somehow to add into hand made menu.
How shoould I do it?
Thanks for help and ideas.
Mike
Comments
Why not use the menu module to construct the menu?
Under "Administer" -> "Site building" -> "Menus" you can add your own menus.
different thing
I now that I can do it but this is a differebt question.
I have to build the menu myself and hardcode into my template. it can not be any of dynamic - automatic created menus.
Is there a way of getting CLASS="ACTIVE" to be implemented...
What function does it for primary links??
Which parameter should I put into my template to get CLASS="ACTIVE" when the link should be active ??
Thanks
Mike
=-=
it's done in .css you can find the declaration using firebug addon for firefox and working backwards.
_____________________________________________________________________
Confucius says:
"Those who seek drupal answers should use drupal search!" : )
how to make link Active??
I now that I can do it but this is a different question.
I dont think its CSS either. It has to be called by some php function which checks the url of the page and compare to available links. How would you do that with css ??
I have to build the menu myself and hardcode into my template. it can not be any of dynamic - automatic created menus.
That is gonna be my only menu (no primary links or other navigation on the page)
I have to do it by hand because it is not a list or line of links. Its going around the page in a very custom
way ;)
Is there a way of getting CLASS="ACTIVE" to be implemented...
What function does it for primary links?? Is it gonna work if primary are hidden?
Which parameter should I put into my template to get CLASS="ACTIVE" when the link should be active ??
Thanks for all your answers and help
Mike
I think this may help
This is untested but I think it will help. Note this requires you pass it a valid Drupal path (ie one know by the menu system and unaliased).
So add this function to your template.php file
And in you page.tpl.php you can do something like.
How can I ???
How can I get you a beer??
This is amazing. Thanks a lot !!!!
That works perfect. It is tested and implemented.
Thanks again
Mike
Adding other attributes
If you want other attributes other than class you can change
to something like
thanks
great help
that solved my problem..
thanks again
Mike